/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tubes1sister.tracker;

/**
 *
 * @author Muhammad Anis
 */
public class TrackerRequest {
    //parameter-parameter yang diperlukan untuk request ke tracker
    String info_hash; //filename yang sudah di encode dengan SHA1
    int port;
    int uploaded;
    int downloaded;
    int left;
    int event;
    //deklarasi Event
    //konstruktor
    public TrackerRequest(){
        //do nothing
    }
    public TrackerRequest(String info_hash,int port,int uploaded,int downloaded,int left,int event){
        this.info_hash = info_hash;
        this.port = port;
        this.uploaded = uploaded;
        this.downloaded = downloaded;
        this.left = left;
        this.event = event;
    }

    public String makeUrl(String domain){
        String temp ="http://" + domain + "?";
        temp+="info_hash="+this.info_hash+"&&";
        temp+="port="+this.port+"&&";
        temp+="uploaded="+this.uploaded+"&&";
        temp+="downloaded="+this.downloaded+"&&";
        temp+="left="+this.left+"&&";
        temp+="event="+this.event;
        return temp;
    }
    


}
